package auditenergetic;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.ext.DefaultHandler2;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */




public class Date_Proiect extends DefaultHandler2 {

    boolean cod = false;
    boolean denumire = false;
    boolean adresa = false;
    boolean judet = false;
    boolean localitate = false;
    boolean proiectant = false;
    public static String c,d,a,j,l,p;
   
    @Override
   public void startElement(String nsURI, String strippedName,String tagName, Attributes attributes)
    throws SAXException
    {
        if (tagName.equalsIgnoreCase("cod"))
            cod = true;
        if (tagName.equalsIgnoreCase("denumire"))
            denumire = true;
        if(tagName.equalsIgnoreCase("adresa"))
            adresa = true;
        if (tagName.equalsIgnoreCase("judet"))
            judet = true;
        if (tagName.equalsIgnoreCase("localitate"))
            localitate = true;
        if (tagName.equalsIgnoreCase("proiectant"))
            proiectant = true;

    }@Override
    public void characters(char[] ch,int start, int length)
    {
        if (cod)
        {
            c =  new String(ch,start,length);
            cod = false;
        } else if (denumire)
        {
            d = new String(ch,start,length);
            denumire = false;
        } else if (adresa)
        {

            a = new String(ch,start,length);
           /* String a = new String(ch,start,length);
             if (a.equals("caramida"))
                System.out.println("ana");
            pereti = false;*/
            adresa = false;
        }else if(judet)
        {
             j = new String(ch,start,length);
             judet = false;
        }
        else if(localitate)
        {
             l = new String(ch,start,length);
             localitate = false;
        }
        else if(proiectant)
        {
             p = new String(ch,start,length);
             proiectant = false;
        }
    }
    public static String print()
    {
        return c+"/"+d+"/"+a+"/"+j+"/"+l+"/"+p;
    }
}